<?php get_header(); ?>
<main role="main" class="">
<?php while (have_posts()) : the_post(); ?>
    <?php set_views(get_the_ID()); ?>
    <section id="breadcrumbs" class="breadcrumbs">
        <?php $categorys = get_the_category(); ?>
        <div class="container py-3">
            <div class="py-lg-5 d-flex flex-column justify-content-center align-items-center">
                <h1><?php the_title(); ?></h1>
                <ol>
                    <li><a href="<?php home_url('/'); ?>">home page</a></li>
                    <?php if($categorys) :?>
                    <?php foreach ($categorys as $key => $category) : ?>
                        <li><a href="<?php echo get_term_link($category->term_id); ?>"><?php echo $category->name; ?></a></li>
                    <?php endforeach;?>
                    <?php endif; ?>
                </ol>
            </div>
        </div>
    </section>
    <div class="container my-5">
        <div class="row news">
            <div class="col-lg-9 content">
                <h4><?php the_title(); ?></h4>
                <p class="info">
                    <?php if($categorys) :?>
                        <?php $category = array_pop($categorys);?>
                    <i class="fa fa-folder-open-o"></i>
                    <a href="<?php echo get_term_link($category->term_id); ?>" rel="category"><?php echo $category->name; ?></a>
                    <?php endif; ?>
                    <i class="fa fa-calendar-minus-o"></i> <?php the_time('Y-m-d H:i:s'); ?> 
                    <i class="fa fa-eye"></i> <?php echo get_views(get_the_ID());?>
                </p>
                <?php the_content(); ?>
            </div>
            <!-- col-lg-9 -->
            <div class="col-lg-3 pb-5 sidebar-contact wow fadeInUp">
                <div class="bg-light-customer p-3">
                    <div class="section-title-page">
                        <h4>Category Column<span></span></h4>
                    </div>
                    <ul>
                        <?php $categorys = get_categories(); ?>
                        <?php foreach ($categorys as $category) : ?> 
                            <li><a href="<?php echo get_term_link($category->term_id); ?>"><?php echo $category->name;?></a></li>
                        <?php endforeach; ?>
                    </ul>
                </div>
            </div>
        </div>
        <!-- col-lg-3 -->
    </div>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>